<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>v-css</title>
<script src="../js/vue.js"></script>
<style>

	.red{
	
		color:red;
	}
	.white{
	
		color:black;
	}
</style>
</head>
<body>
<div id="app">

	
	
	<div  v-bind:class="[ classObject.active ? red:white ]">白红</div>

	<button @click="chgactive">改变样式</button>
</div>
<script>
 new Vue({
        el: '#app',
        data: {
			classObject: {
				active: true
			},
			red:'red',
			white:'white'
			
        },
		mounted: function(){
		

		},
        methods: {
			chgactive:function(){
			
				this.classObject.active=!this.classObject.active;
			}
        }
    });
</script>
</body>
</html>
